import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
  plugins: [
    react(),
  ],
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true, // 必须开启才能正确解析antd的less样式
        modifyVars: {
          '@primary-color': '#1890ff', // 自定义主题色
        },
      },
    },
    modules: {
      localsConvention: 'camelCase', // 将类名转换为驼峰命名
    }
  },
  server: {
    host: true, // 允许局域网访问
  },
  resolve: {
    alias: {
      '@': '/src',
    },
  },
});